<?php
namespace Home\Controller;
use Think\Controller;
class GoodsController extends CommonController {
    public function lists(){
        $cate=D('cate')->select();
        $brand=D('brand')->select();
        $goods=D('Admin/goods')->relation(true)->select();
        $this->assign('goods',$goods);
        $this->assign('cate',$cate);
        $this->assign('brand',$brand);
        $this->display();
    }
    public function detail(){

        $id=i('get.id');
        $cate=D('cate')->select();
        $brand=D('brand')->select();
        $goods=D('Admin/goods')->where("id=$id")->relation(true)->find();
        $pid=$goods['pid'];

        $spec=D('spec')->where("g_type_id=$pid")->select();

        //print_r($goods);die;
        $spec_item=D('spec_item')->select();
        $this->assign('good_img',$good_img);
         //print_r($goods);die;
        $this->assign('spec',$spec);
        $this->assign('spec_item',$spec_item);
        $this->assign('goods',$goods);
        $this->assign('cate',$cate);
        $this->assign('brand',$brand);
        $this->display();
    }
}